package com.gdqy.FCS.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gdqy.FCS.entity.User;
import com.gdqy.FCS.service.UserService;

@Controller
public class Testpassword {
	
	@Autowired
	private UserService userService;
	
	@RequestMapping("Testpassword")
	public void test(){
		PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
		User user = userService.selectByName("1234");
		String password = passwordEncoder.encode("123");
		
		System.out.println(passwordEncoder.matches("123", password));
	}

}
